/**
 * 工具函数
 * 万亿数据的处理
 * ps: 34809234.00===>3480.92万
 */
export const unitFormat = function(value) {
    if (!value) return "0";
    var param = {
      percent: value < 0 ? "-" : ""
    };
    value = value.replace(/-/g, "");
    var k = 10000,
      sizes = ["", "万", "亿", "万亿"],
      i;
    if (value < k) {
      param.value = value;
      param.unit = "";
    } else {
      i = Math.floor(Math.log(value) / Math.log(k));
  
      param.value = (value / Math.pow(k, i)).toFixed(2);
      param.unit = sizes[i];
    }
    return `${param.percent + param.value + param.unit}`;
  };


  